import querystring from 'querystring';
import { DictionaryData, MenuData } from './data';
export default function(mock) {
  // 获取字典数据
  mock.onPost('/bfs/bfs/configuration/dictionary').reply(config => {
    const { categoryClass } = querystring.parse(config.data);
    return new Promise((resolve, reject) => {
      resolve([200, DictionaryData[categoryClass]]);
    });
  });

  // 获取菜单数据
  mock.onPost('/bfs/bfs/menu/queryUserChildMenu').reply(config => {
    return new Promise((resolve, reject) => {
      resolve([200, MenuData]);
    });
  });
}
